﻿Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.Runtime.CompilerServices
Imports System.Threading
Imports System.Windows.Forms

Namespace Stickam_Client
    <DesignerGenerated> _
    Public Class Form_UserInfo
        Inherits Form
        ' Methods
        <DebuggerNonUserCode> _
        Public Sub New()
            AddHandler MyBase.Load, New EventHandler(AddressOf Me.Form_UserInfo_Load)
            Me.InitializeComponent
        End Sub

        <DebuggerNonUserCode> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try 
                If (disposing AndAlso (Not Me.components Is Nothing)) Then
                    Me.components.Dispose
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub

        Private Sub Form_UserInfo_Load(ByVal sender As Object, ByVal e As EventArgs)
            Me.ProfileLink.Text = Conversions.ToString(Operators.AddObject("http://www.stickam.com/", Me.FormParent.Userlist.getParam(Me.UserID, Me.FormParent.Userlist.userName)))
            Dim right As String = "Guest"
            If Conversions.ToBoolean(Me.FormParent.Userlist.getParam(Me.UserID, Me.FormParent.Userlist.isModerator)) Then
                right = "Mod"
            End If
            If Conversions.ToBoolean(Me.FormParent.Userlist.getParam(Me.UserID, Me.FormParent.Userlist.isOwner)) Then
                right = "Owner"
            End If
            If Conversions.ToBoolean(Me.FormParent.Userlist.getParam(Me.UserID, Me.FormParent.Userlist.isVideo)) Then
                right = (right & ", on cam")
            End If
            If Conversions.ToBoolean(Me.FormParent.Userlist.getParam(Me.UserID, CInt(-(Me.FormParent.Userlist.isIgnored > False)))) Then
                right = (right & ", ignored.")
            Else
                right = (right & ", unignored.")
            End If
            Me.InRoomInfo.Text = Conversions.ToString(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject("Display Name: ", Me.FormParent.Userlist.getParam(Me.UserID, Me.FormParent.Userlist.screenName)), ChrW(13) & ChrW(10)), "Status: "), right), ChrW(13) & ChrW(10)), "Username: "), Me.FormParent.Userlist.getParam(Me.UserID, Me.FormParent.Userlist.userName)), ChrW(13) & ChrW(10)), "User ID: "), Me.UserID), ChrW(13) & ChrW(10)), "Hex ID: 0x"), Conversion.Hex(RuntimeHelpers.GetObjectValue(Conversion.Int(Me.UserID)))))
            New Thread(New ThreadStart(AddressOf Me.LoadProfileInfo)).Start
        End Sub

        <DebuggerStepThrough> _
        Private Sub InitializeComponent()
            Dim manager As New ComponentResourceManager(GetType(Form_UserInfo))
            Me.ProfileImage = New PictureBox
            Me.GroupBox1 = New GroupBox
            Me.InRoomInfo = New Label
            Me.ProfileInfo = New Label
            Me.ProfileLink = New LinkLabel
            Me.Label1 = New Label
            DirectCast(Me.ProfileImage, ISupportInitialize).BeginInit
            Me.GroupBox1.SuspendLayout
            Me.SuspendLayout
            Me.ProfileImage.InitialImage = Nothing
            Dim point As New Point(9, 1)
            Me.ProfileImage.Location = point
            Me.ProfileImage.Name = "ProfileImage"
            Dim size As New Size(120, 90)
            Me.ProfileImage.Size = size
            Me.ProfileImage.SizeMode = PictureBoxSizeMode.StretchImage
            Me.ProfileImage.TabIndex = 0
            Me.ProfileImage.TabStop = False
            Me.GroupBox1.Controls.Add(Me.InRoomInfo)
            point = New Point(140, 1)
            Me.GroupBox1.Location = point
            Me.GroupBox1.Name = "GroupBox1"
            size = New Size(180, &H91)
            Me.GroupBox1.Size = size
            Me.GroupBox1.TabIndex = 1
            Me.GroupBox1.TabStop = False
            Me.GroupBox1.Text = "In-Room Info"
            Me.InRoomInfo.AutoSize = True
            point = New Point(6, &H10)
            Me.InRoomInfo.Location = point
            Me.InRoomInfo.Name = "InRoomInfo"
            size = New Size(&H39, 13)
            Me.InRoomInfo.Size = size
            Me.InRoomInfo.TabIndex = 0
            Me.InRoomInfo.Text = "[Info Here]"
            Me.ProfileInfo.AutoSize = True
            point = New Point(-2, &H5E)
            Me.ProfileInfo.Location = point
            Me.ProfileInfo.Name = "ProfileInfo"
            size = New Size(&H59, 13)
            Me.ProfileInfo.Size = size
            Me.ProfileInfo.TabIndex = 2
            Me.ProfileInfo.Text = "[Profile Info Here]"
            Me.ProfileLink.AutoSize = True
            point = New Point(&H38, &H92)
            Me.ProfileLink.Location = point
            Me.ProfileLink.Name = "ProfileLink"
            size = New Size(&H81, 13)
            Me.ProfileLink.Size = size
            Me.ProfileLink.TabIndex = 3
            Me.ProfileLink.TabStop = True
            Me.ProfileLink.Text = "http://www.stickam.com/"
            Me.Label1.AutoSize = True
            point = New Point(-2, &H92)
            Me.Label1.Location = point
            Me.Label1.Name = "Label1"
            size = New Size(&H3E, 13)
            Me.Label1.Size = size
            Me.Label1.TabIndex = 4
            Me.Label1.Text = "Profile Link:"
            Dim ef As New SizeF(6!, 13!)
            Me.AutoScaleDimensions = ef
            Me.AutoScaleMode = AutoScaleMode.Font
            size = New Size(&H141, 160)
            Me.ClientSize = size
            Me.Controls.Add(Me.Label1)
            Me.Controls.Add(Me.ProfileLink)
            Me.Controls.Add(Me.ProfileInfo)
            Me.Controls.Add(Me.ProfileImage)
            Me.Controls.Add(Me.GroupBox1)
            Me.FormBorderStyle = FormBorderStyle.FixedToolWindow
            Me.Icon = DirectCast(manager.GetObject("$this.Icon"), Icon)
            Me.Name = "Form_UserInfo"
            Me.StartPosition = FormStartPosition.Manual
            Me.Text = "User Info"
            DirectCast(Me.ProfileImage, ISupportInitialize).EndInit
            Me.GroupBox1.ResumeLayout(False)
            Me.GroupBox1.PerformLayout
            Me.ResumeLayout(False)
            Me.PerformLayout
        End Sub

        Private Sub LoadProfileInfo()
            Dim str As String = Me.RemoveSpaces(Me.FormParent.getWebpage(Conversions.ToString(Operators.AddObject("http://www.stickam.com/profile/", Me.FormParent.Userlist.getParam(Me.UserID, Me.FormParent.Userlist.userName)))))
            Dim str4 As String = Strings.Mid(str, (Strings.InStr(str, "<div class=""profileImage"">", CompareMethod.Binary) + &H24))
            Me.ProfileImage.ImageLocation = Strings.Mid(str4, 1, (Strings.InStr(str4, """", CompareMethod.Binary) - 1))
            Dim str2 As String = "N/A"
            Dim str3 As String = "N/A"
            Dim str6 As String = "N/A"
            Dim str5 As String = "N/A"
            If (Strings.InStr(str, "Age:", CompareMethod.Binary) <> 0) Then
                str2 = Strings.Mid(str, (Strings.InStr(str, "Age:", CompareMethod.Binary) + &H10))
                str2 = Strings.Mid(str2, 1, (Strings.InStr(str2, "<", CompareMethod.Binary) - 1))
            End If
            If (Strings.InStr(str, "Gender:", CompareMethod.Binary) <> 0) Then
                str3 = Strings.Mid(str, (Strings.InStr(str, "Gender:", CompareMethod.Binary) + &H13))
                str3 = Strings.Mid(str3, 1, (Strings.InStr(str3, "<", CompareMethod.Binary) - 1))
            End If
            If (Strings.InStr(str, "Profile Views:", CompareMethod.Binary) <> 0) Then
                str6 = Strings.Mid(str, (Strings.InStr(str, "Profile Views:", CompareMethod.Binary) + &H1A))
                str6 = Strings.Mid(str6, 1, (Strings.InStr(str6, "<", CompareMethod.Binary) - 1))
            End If
            If (Strings.InStr(str, "Member Since:", CompareMethod.Binary) <> 0) Then
                str5 = Strings.Mid(str, (Strings.InStr(str, "Member Since:", CompareMethod.Binary) + &H17))
                str5 = Strings.Mid(str5, 1, (Strings.InStr(str5, "<", CompareMethod.Binary) - 1))
            End If
            Me.ProfileInfo.Text = String.Concat(New String() { "Age: ", str2, ChrW(13) & ChrW(10) & "Gender: ", str3, ChrW(13) & ChrW(10) & "Profile Views: ", str6, ChrW(13) & ChrW(10) & "Member Since: ", str5 })
        End Sub

        Private Sub ProfileLink_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs)
            Process.Start(Me.ProfileLink.Text)
        End Sub

        Private Function RemoveSpaces(ByVal HtmlData As String) As String
            Return Strings.Replace(Strings.Replace(HtmlData, ChrW(9), "", 1, -1, CompareMethod.Binary), ChrW(13) & ChrW(10), "", 1, -1, CompareMethod.Binary)
        End Function


        ' Properties
        Friend Overridable Property GroupBox1 As GroupBox
            <DebuggerNonUserCode> _
            Get
                Return Me._GroupBox1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As GroupBox)
                Me._GroupBox1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property InRoomInfo As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._InRoomInfo
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._InRoomInfo = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label1 As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._Label1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._Label1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property ProfileImage As PictureBox
            <DebuggerNonUserCode> _
            Get
                Return Me._ProfileImage
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As PictureBox)
                Me._ProfileImage = WithEventsValue
            End Set
        End Property

        Friend Overridable Property ProfileInfo As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._ProfileInfo
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._ProfileInfo = WithEventsValue
            End Set
        End Property

        Friend Overridable Property ProfileLink As LinkLabel
            <DebuggerNonUserCode> _
            Get
                Return Me._ProfileLink
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As LinkLabel)
                Dim handler As LinkLabelLinkClickedEventHandler = New LinkLabelLinkClickedEventHandler(AddressOf Me.ProfileLink_LinkClicked)
                If (Not Me._ProfileLink Is Nothing) Then
                    RemoveHandler Me._ProfileLink.LinkClicked, handler
                End If
                Me._ProfileLink = WithEventsValue
                If (Not Me._ProfileLink Is Nothing) Then
                    AddHandler Me._ProfileLink.LinkClicked, handler
                End If
            End Set
        End Property


        ' Fields
        <AccessedThroughProperty("GroupBox1")> _
        Private _GroupBox1 As GroupBox
        <AccessedThroughProperty("InRoomInfo")> _
        Private _InRoomInfo As Label
        <AccessedThroughProperty("Label1")> _
        Private _Label1 As Label
        <AccessedThroughProperty("ProfileImage")> _
        Private _ProfileImage As PictureBox
        <AccessedThroughProperty("ProfileInfo")> _
        Private _ProfileInfo As Label
        <AccessedThroughProperty("ProfileLink")> _
        Private _ProfileLink As LinkLabel
        Private components As IContainer
        Public FormParent As Form1
        Public UserID As String
    End Class
End Namespace

